#pragma once
#include "..\Core\System.h"
#include <map>

namespace GUIToolkit
{
	class Window;

	class Control;

	static class Application
	{
	private:
		static Application app;

		std::map<HWND, Window*> windows;
		Window* main;
		Control* focus;
		ULONG_PTR token;
		Application(void);

	public:
		static event OnRun;
		static event OnIdle;
		static event OnExit;

	public:
		static int Run(Window* main = NULL);

		static Window* GetMainWindow()
		{
			return app.main;
		}

		static Control* GetFocus();

		static void SetFocus(Control* ui);

		static void Exit();

		~Application(void);
	};

}